package cn.zhaoyuening.crm.dao.impl;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import cn.zhaoyuening.crm.dao.StaffDao;
import cn.zhaoyuening.crm.domain.CrmStaff;

public class StaffDaoImpl extends BaseDaoImpl<CrmStaff> implements StaffDao {
	
	
	public CrmStaff login(CrmStaff staff) {
		List<CrmStaff> list = getHibernateTemplate().find("from CrmStaff where loginName=? and loginPwd=?",
				staff.getLoginName(),staff.getLoginPwd());
		
		if (list!=null&&list.size()==1) {
			return list.get(0);
		}
		return null;
	}
	

}
